/// *
// * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
// * <p>
// * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// * <p>
// * http://www.gnu.org/licenses/lgpl.html
// * <p>
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//
// package org.zebra.mybatis.plus.curd;
//
// import org.springframework.lang.NonNull;
// import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
// import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
//
// import java.lang.reflect.Method;
//
/// **
// * 暂时不用，没有想到更好得方式
// * CRUD 请求映射器处理器映射器
// *
// * @author zhanghongbin
// */
// @Deprecated
// public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMapping {
//
//    @Override
//    protected RequestMappingInfo getMappingForMethod(@NonNull Method method, @NonNull Class<?> handlerType) {
//        RequestMappingInfo requestMappingInfo = super.getMappingForMethod(method, handlerType);
//        if (null == requestMappingInfo) {
//            return null;
//        }
//        return requestMappingInfo;
//        //        // 如果没有声明 @CrudRequestMapping 注解，直接返回
//        //        if (!handlerType.isAnnotationPresent(CrudRequestMapping.class)) {
//        //            return requestMappingInfo;
//        //        }
//        //        CrudRequestMapping crudRequestMapping = handlerType.getDeclaredAnnotation(CrudRequestMapping.class);
//        //        // 过滤 API，如果非本类中定义，且 API 列表中不包含，则忽略
//        //        Api[] apiArr = crudRequestMapping.api();
//        //        Api api = ExceptionUtils.exToNull(() -> Api.valueOf(method.getName().toUpperCase()));
//        //        if (method.getDeclaringClass() != handlerType && !ArrayUtil.containsAny(apiArr, Api.ALL, api)) {
//        //            return null;
//        //        }
//        //        // 拼接路径（合并了 @RequestMapping 的部分能力）
//        //        return this.getMappingForMethodWrapper(method, handlerType, crudRequestMapping);
//    }
//
//    //    private RequestMappingInfo getMappingForMethodWrapper(@NonNull Method method, @NonNull Class<?> handlerType,
//    // CrudRequestMapping crudRequestMapping) {
//    //        RequestMappingInfo info = this.createRequestMappingInfo(method);
//    //        if (null != info) {
//    //            RequestMappingInfo typeInfo = this.createRequestMappingInfo(handlerType);
//    //            if (null != typeInfo) {
//    //                info = typeInfo.combine(info);
//    //            }
//    //            String prefix = crudRequestMapping.value();
//    //            if (null != prefix) {
//    //                RequestMappingInfo.BuilderConfiguration options = new RequestMappingInfo.BuilderConfiguration();
//    //                options.setPatternParser(PathPatternParser.defaultInstance);
//    //                info = RequestMappingInfo.paths(prefix).options(options).build().combine(info);
//    //            }
//    //        }
//    //        return info;
//    //    }
//
//    //    private RequestMappingInfo createRequestMappingInfo(AnnotatedElement element) {
//    //        RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(element,
// RequestMapping.class);
//    //        RequestCondition<?> condition = (element instanceof Class<?> clazz ?
//    //                getCustomTypeCondition(clazz) : getCustomMethodCondition((Method) element));
//    //        return (requestMapping != null ? createRequestMappingInfo(requestMapping, condition) : null);
//    //    }
// }
